package com.cmii.sjw.department.control.jsc.controller;

import com.cmii.sjw.department.control.jsc.model.UniversityDigitalization;
import com.cmii.sjw.department.control.jsc.model.dto.UniversityDigitalizationDTO;
import com.cmii.sjw.department.control.jsc.service.UniversityDigitalizationService;
import com.cmii.sjw.department.control.jsc.util.Result;
import org.springframework.web.bind.annotation.*;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * 高校核心业务数字化率统计表
 *
 * @author lizheng
 * @date 2025-07-16
 */
@RestController
@CrossOrigin
@RequestMapping("/digitalization")
public class UniversityDigitalizationController {

    @Resource
    private UniversityDigitalizationService universityDigitalizationService;

    /**
     * 高校核心业务数字化率统计表
     *
     * @return 列表
     */
    @PostMapping("/list")
    public Result<List<UniversityDigitalization>> list() {
        List<UniversityDigitalization> list = universityDigitalizationService.list();
        return Result.success(list);
    }

    /**
     * 核心业务事项数字化统计
     *
     * @return 统计数据
     */

    @PostMapping("/stats")
    public Result<UniversityDigitalizationDTO> getDigitalizationStats() {
        UniversityDigitalizationDTO stats = universityDigitalizationService.getDigitalizationStats();
        return Result.success(stats);
    }
}
